n Electronic Production

Prepping the cut


To create the gcode we use the fabmodules It's a simple interface that gets the job done! For pcb milling I normally use either flatcam or the pluggin PCB-Gcode for eagle. But since we didn't draw the pcb this week I figure the easiest way to generate a Gcode from a png file was to just uplaud it via the fabmodules.

First I upload the png file on the module:



Then I set the output as Gcode :



- And Finally the process wich is in this case pcb outline 1/64:



For my first try I used the default settings.



Then I save the file and look at the Gcode to see if everything was ok.



The cut deph seems ok since I knew that the command G20 means that the code was read in inches.

To control my machine and to send the gcode I use a java program call universal Gcode sender. This open source program is easy to use and to understand. Back then we were using linux cnc at the lab but I hack the machine with an arduino and the grbl program to give us the possibilities to work with different computer and gcode sender. for more information about this process visit this link. (sorry it's in french!)

« Go back to assigments page

Milling the board


It took a few tries to mill the board correctly. The CNC at our lab is an old zenbot and we realize that the cnc was not level correctly...

First we need to put the good mill on the cnc, I use a 1/8 collet to fit the mill:



To home the cnc we didn't have any pressure sensor for the z axis, so this was also a bit of a hassle. here is the first board we made:



The cut line were way to thick, so we try it again but we home the z-axis a bit higher


This looks good! let's see it's working, I use a multimeter to see the conductivity between the line:



Unfortunally, the cut lines are too thin, the conductivity still pass...Then we try again, and again! After a few tries we realize that our cnc was not on level and we may not achieve to mill correctly our pcb on the machine, so we went to the fablab du pec that is manage by our instructor raphael

Raph got a roland micro-cnc machine that made an amazing job for us, we use the exact same gcode and process, exept the z-homing wich was done with a pressure sensor and achieve these board on the first try!



Now that the board are mill, it was time for the real hassle, soldering my first surface mount board and programming the ISP!

« Go back to assigments page

Soldering the board


Soldering the board was really fun but also stressful, the component were so small it took a lot of patience and perseverance to achieve the board. After a few pratice board we found a good way to keep the tiny component in place while we were trying to solder them, crazy glue! This help a lot to solder everything without having to constantly repositioning the component.

Also, to avoid having the tin to make small bubble and to make sure it goes smooth on the board, I realised I needed to heat the board correctly before appling the tin.

Later, I also found that use flux is a game changer while soldering SMD component, the flux help the tin to adhere on the copper and just lays out on the surface.

The temperature of the Iron must also be appropriated, I found that setting my Iron not hot enouph makes it really difficult for the adhesion of my tin on the copper, while having it too hot sometimes melt the thin layer of copper on my board and break the board. I found that a good temperature for my iron was around 290 degrees celsius.

edit: After a while, soldering small component became more and more easy, it's now pretty natural for me to work with SMD instead of trough hole and I really enjoy doing this work. Just put some classical music in you hear and be patient. Also the right tool is a must if you want to avoid any frustration. I found that having a good soldering iron is a must, as well as good third helping hand and a pair of pliers for manipulating the component. Also, a multimeter is a absolute must to make sure there is no short and that continuity is good on your board. So after a few board, I finally manage to get something I was really proud of and here we are!, perseverance is the key in these situation. Also, for the FabISP the first thing you want to solder is the usb outlet and the attiny because these are the two thing you may fail and have to desolder/redo.

Here are the final resutls, I'm really happy with it, the key is patience when soldering such small components



« Go back to assigments page

Programming the board


Programming the board was really easy once my board was solder correctly, I had a few try at first where the "make fuse" command did'nt work due to the board being not solder correctly. I program my board using the ubuntu OS and another working FabISP.

following the simple instruction found here , I first plug my ISP into the computer and wait to see if there was any kind of error message about the board drawing too much power, this would indicate most likely a short on my circuit.
....
No message! were ok.

Now to the Firmware Installation, this has been done without any issues and was pretty straigtforward following the tutorial above.
I just opened a terminal on Ubuntu and enter these command
  

  sudo apt-get install flex byacc bison gcc libusb-dev avrdude  

  sudo apt-get install gcc-avr 

  sudo apt-get install avr-libc 

  sudo apt-get install libc6-dev

               


Now that our necessary driver are installed with sucess we need to go go (cd) into our Firmware Folder and enter these command:
  

make clean



make hex





Finally let's connect our ISP into our usb socket and enter these command again in the firmware folder:
  

make fuse

make program 



Now that your ISP is programmed I will prepare the Arduino IDE to be able to uplaud code using the FabISP.

Next I had to set-up my arduino IDE to be able to program via an attiny44, to do so, I followed this tutorial. First thing I had to do was to install the the Attiny support using the buit-in boards manager inside the Arduino IDE.

You need to go in the arduino preference and add an additional board manager URL: https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json



Once this is done, you can go into the board manager and install the Attiny support.



After that, you only need to go and setup your fabisp using these parameters, they are pretty straith forward.







One thing that is important to know is that only a few arduino command are compatible with the Attiny's, here is a list of those command, you will have to find some work around to work with other command such as serial read and write.
  


                 pinMode()
digitalWrite()
digitalRead()
analogRead()
analogWrite()
shiftOut()
pulseIn()
millis()
micros()
delay()
delayMicroseconds()
SoftwareSerial


It worked, my device is now shown as a USBtiny into my Device manager and I can uplaud code using the arduino IDE into other microcontrollers!